FROM node:14.16.1 as builder
WORKDIR /code
COPY . /code
RUN npm config set registry http://registry.npm.taobao.org/
RUN npm cache clean --force
RUN npm install
RUN npm run build

FROM nginx:alpine
COPY --from=builder code/dist /usr/share/nginx/html
EXPOSE 80